<template>
    <div>
      <translate-group>

      </translate-group>
    </div>
</template>

<script>
   import TranslateGroup from '@/real-components/TranslateTest'
    import {queryDiscount ,queryUserInfo} from '@/utils/ReturnAxios'
  export default {
    data () {
      return {
      }
    },
    created () {
      var userInfo = this.userInfo
      if(!userInfo){
        this.queryUserInfo()
      }

    },
    mounted () {

    },
    components: {
      TranslateGroup
    },
    methods: {
      //获取用户信息
      async queryUserInfo () {
        var res = await queryUserInfo()
        res =res.data
        console.log(res , 'res')
      },
      //获取优惠券信息
      async queryDiscount () {
        var phone = this.phone
        console.log('phone', phone)
        var   res = await queryDiscount (phone)
        res = res.data
        console.log(res)
      }

    },
    computed:{
      userInfo () {
        return this.$store.state.wxh.userInfo
      },
      phone () {
        if (this.userInfo) {
          return this.userInfo.phone
        }
        return ''
      }
    },
    watch: {
      phone (data) {
        if (data) {
          this.queryDiscount()
        }
      }
    }
  }
</script>

<style>

</style>
